1. Field of the Invention
The present invention relates to an information processing apparatus, which is connected to a printer via a network, for controlling the printer.
2. Description of the Related Art
Conventionally, a printing system comprises a color printer capable of a color output, a host computer for controlling the printer and generating print data, and a communication interface connecting the printer and the host computer. An operating system runs on the host computer and a variety of software runs on the operating system. When various documents that have been created using application software are printed, the application software, a printer driver and the operating system execute function call, etc., through a stipulated procedure. Data is exchanged and a printer command (inclusive of print data) is generated through this procedure. The printer driver transfers the generated printer command to the printer, whereby printing is carried out. The printer driver is equipped with a function for performing bidirectional communication with the printer using a communication function provided by the operating system, and for displaying printer status information on a display screen. This enhances user convenience.
In general, the printing system of an operating system has a print queue, spools print jobs from the application software temporarily and then processes the print jobs successively. Owing to the action of the print queue, the application software can be freed from the print processing without waiting for the completion of printing by the printer. The printing system quits printing when all of the spooled print jobs have been sent to the printer.
There are cases where a print job that has been spooled in a print queue is desired to be printed again after the printing of the job has ended. In such case, with an operating system such as Microsoft's Windows Vista (registered trademark), the print job can be left in the print queue by turning on a “Keep printed documents” setting.
Further, there are also printers in which, when printing is to be cancelled, this can be achieved by pressing a cancel key on the printer in addition to canceling the printing from the print queue. This also enhances user convenience (see the specification of Japanese Patent Laid-Open No. 2002-200825).
As for communication interfaces, the USB (Universal Serial Bus) is available and so is WSD (Web Services on Devices), which has come to be employed in Windows Vista (registered trademark) in recent years. Printing by WSD is event-based. For example, if a paper-jam error occurs in the printer, the host computer is notified of this fact by the event. When printing ends, a JobEndStateEvent is sent from the printer to the host computer so that the host computer is capable of ascertaining when printing ended. [See Implementing Web Services on Devices for printing and scanning (the website at microsoft.com in the subdirectory japan in the subdirectory whdc in the subdirectory connect in the subdirectory rally in the subdirectory wsdspecs.mpsx)].
In the case of event-based printing such as that using WSD, a port monitor, which is one type of device driver of the operating system, executes print-end processing in response to the JobEndStateEvent sent from the printer to the host computer.
However, there are instances where print-end processing by the port monitor and termination of printing by the printing system of the operating system are not executed in the correct order.
By way of example, in a case where the “Keep printed documents” setting printing is turned on using the user interface (UI) of the print queue and printing is cancelled by pressing the cancel button on the printer during WSD-based printing, a problem which arises is that the print job which is supposed to be left in the queue is deleted from the queue.
Because a print job end processing by the port monitor is occurred due to transmission of JobEndState Event from the printer to the host computer after the printing system of the operating system completes end processing of the print job. Therefore, by the print job end processing, the print job, which is left in the queue, is deleted by the port monitor.